<?
class BlogAction extends Action {
  private $_dev = 0;
  function _initialize() {
    $this->_dev = C("DEV_FLAG");
    $this->assign('dev', $this->_dev);
    $this->assign("istp", 1);//circle-header2中有TP和PHPWIND都用到，加上这个参数进行区别
  }

  public function index() {
    //;
    //专栏推荐
	//var_dump();
	load('@.circle');
    $this->assign('zltj_list', getRecommendList(3));
    //热门博文
    $list = getRecommendList(4);
    $list[0]['content'] = $this->_substrContent($list[0]['content'],50);
    $list[1]['content'] = $this->_substrContent($list[1]['content'],50);
    $this->assign('rmbw_list', $list);
    //活跃会员
    $this->assign('active_members', getMembers(1));
    //最新会员
    $this->assign('new_members', getMembers(2));
    //最新博文
    $this->assign('new_blogs', getBlogsList(1));
    //排行榜
    $this->assign('ranking_list', getBlogsList(2));
    $this->assign('isblog',1);
    $this->display();
  }

  private function _substrContent($content,$length) {
    $content = preg_replace ( "/(\<[^\<]*\>|\r|\n|\s|\[.+?\])/is", ' ', $content);
    return formatTitle($content,$length);
  }


}
?>